<extend name="Base/common"/>
<block name="style">
    <style type="text/css">
        h1 {
            font-size: 24px;
            color: #009688;
            /*text-align: center;/*/
            margin: 10px 30px;
        }

        .btn1 {
            text-align: center;
            margin-top: 30px;
        }

        .explain {
            display: block;
            margin-left: 111px;
        }
    </style>
</block>
<block name="body">


    <fieldset class="layui-elem-field site-demo-button" style="margin:20px 10px 20px 5px;padding:30px 5px; ">
        <legend><h1>添加路线</h1></legend>
        <div>
            <form action="" method="post" class="layui-form">
                <!--表单左侧-->
                <div class="diyilie">
                    <div class="layui-form-item" id="addUsersName">
                        <label class="layui-form-label">出发地：</label>
                        <div class="layui-input-block">
                            <input type="text" name="addr_from" placeholder="" class="layui-input">
                        </div>
                        <span class="explain">此车的发车地(例:大学城)</span>
                    </div>
                    <div class="layui-form-item" id="addUsersIDcard">
                        <label class="layui-form-label">目的地：</label>
                        <div class="layui-input-block"><input type="text" name="addr_to" lay-verify="required"
                                                              placeholder="" autocomplete="off" class="layui-input">
                        </div>
                        <span class="explain">此车的目地(例:毕节)</span>
                    </div>
                    <div class="layui-form-item" id="addUserid" name="usr_name">
                        <div class="layui-inline">
                            <label class="layui-form-label">发车时间：</label>
                            <div class="layui-input-block">
                                <input type="text" name="addr_depart_time" id="departTime" autocomplete="off"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item" id="addUsers">
                        <label class="layui-form-label">票价：</label>
                        <div class="layui-input-block">
                            <input type="number" name="addr_price" lay-verify="required" placeholder=""
                                   autocomplete="off"
                                   class="layui-input">
                        </div>
                        <span class="explain">请输入该车次的价格(例如:32)</span>
                    </div>
                    <div class="layui-form-item" id="addUsersPhone">
                        <label class="layui-form-label">车载人数：</label>
                        <div class="layui-input-block">
                            <input type="number" name="addr_depart_person_num" lay-verify="required" placeholder=""
                                   autocomplete="off" class="layui-input">
                        </div>
                        <span class="explain">此车的容量(例如:32)</span>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">路线状态</label>
                        <div class="layui-input-block">
                            <input type="checkbox" checked="" name="addr_status" lay-skin="switch"
                                   lay-filter="switchTest"
                                   lay-text="启用|禁用">
                        </div>
                        <span class="explain">是否启用该路线(如果禁用,当用户在前台点击查询车票时,将查询不到此列车)</span>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">发车状态</label>
                        <div class="layui-input-block">
                            <input type="checkbox" checked="" name="addr_depart_condition" lay-skin="switch"
                                   lay-filter="switchTest" lay-text="必发车|预发车">
                        </div>
                        <span class="explain">此车是必发车还是满足一定条件才发车</span>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">上车地点：</label>
                        <div class="layui-input-block">
                            <input type="text" name="addr_up_place" lay-verify="required" placeholder=""
                                   autocomplete="off" class="layui-input">
                        </div>
                        <span class="explain">用户上车的地点(建议字数在7个字以内,比如:花溪财大正门)</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">下车地点：</label>
                    <div class="layui-input-block">
                        <input type="text" name="addr_down_place" lay-verify="required" placeholder=""
                               autocomplete="off" class="layui-input">
                    </div>
                    <span class="explain">用户下车的地点(建议字数在7个字以内,比如:花溪财大正门)</span>
                </div>
                <!--表单右侧-->


                <div class="layui-form-item">
                    <label class="layui-form-label">保险价格：</label>
                    <div class="layui-input-block">
                        <input value="3" type="text" name="addr_insur" lay-verify="required" placeholder=""
                               autocomplete="off"
                               class="layui-input">
                    </div>
                    <span class="explain">本次保险为多少(一般为3元)</span>
                </div>

                <!--确定-->
                <div class="btn1">
                    <input type="submit" class="layui-btn layui-btn-big" value="提交车次信息">
                </div>
            </form>
        </div>
    </fieldset>


</block>
<block name="script">
    <script>
        layui.use(['form', 'layedit', 'laydate'], function () {
            var form = layui.form
                , layer = layui.layer
                , layedit = layui.layedit
                , laydate = layui.laydate;

            //日期
            laydate.render({
                elem: '#date'
            });
            laydate.render({
                elem: '#date1',
            });
            laydate.render({
                elem: '#departTime'
                , type: 'datetime'

            });
            //监听指定开关
//            form.on('switch(switchTest)', function (data) {
//                layer.msg('开关checked：' + (this.checked ? 'true' : 'false'), {
//                    offset: '6px'
//                });
//                layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
//            });

            //监听提交
//            form.on('submit(demo1)', function (data) {
//                layer.alert(JSON.stringify(data.field), {
//                    title: '最终的提交信息'
//                });
//                return false;
//            });


        });
    </script>
</block>